<%-- 
    Document   : asignafincas
    Created on : 20-nov-2011, 18:19:33
    Author     : petete
--%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
    <form action=index.html>
        <input type="image" src="stylesheets/fondo_admin.jpg" >
    </form>

    <title>Asignar Finca</title>
</head>
<body>
    <c:choose>
        <c:when test="${!empty espacios}">
            <c:forEach var="finca" items="${espacios}">
                <fieldset>
                    <fieldset>
                        <center><legend>Datos</legend></center>
                        Nombre:
                        <c:out value="${finca.nombre}"/><br/>
                        Capacidad:
                        <c:out value="${finca.capacidad}"/><br/>
                        Fecha ocupadas:
                        <c:out value="${finca.ocupado}"/><br/>

                    </fieldset>
                    <fieldset>
                        <center><legend>Información de la finca</legend></center>

                        <c:out value="${finca.comentarios}"/><br/>

                    </fieldset>
                    <table>
                        <tr>
                            <td>
                                <c:if test="${modificar=='modificar'}">
                                    <form action="/modificarfincaasignadaevento" method="post">
                                        <input type="submit" value="Cambiar finca asignada"/>
                                        <input type="hidden" name="id_finca" value="${finca.idString}" />
                                        <input type="hidden" name="id_evento" value="${evento.idString}" />
                                    </form>
                                </c:if>
                                <c:if test="${modificar==null}">
                                    <form action="/anadirfincaalevento" method="post">
                                        <input type="submit" value="Asignar esta finca"/>
                                        <input type="hidden" name="id_finca" value="${finca.idString}" />
                                        <input type="hidden" name="id_evento" value="${evento.idString}" />
                                    </form>
                                </c:if>

                            </td>

                        </tr>
                    </table>


                </fieldset>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <center>No hay fincas guardadas</center>
        </c:otherwise>
    </c:choose>
</body>
</html>
